package com.weixing.mall.provider.controller.front;

import com.weixing.mall.base.wrapper.Result;
import com.weixing.mall.base.wrapper.ResultUtil;
import com.weixing.mall.core.annotation.NoNeedAccess;
import com.weixing.mall.core.support.BaseController;
import com.weixing.mall.provider.service.IAgreementService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping(value = "front/agreement")
@Api(value = "前端:系统协议",tags = "前端:系统协议")
public class FrontAgreementController extends BaseController {
    @Autowired
    private IAgreementService agreementService;

    @ApiOperation(value = "根据code查询对应内容")
    @GetMapping(value = "getByCode/{code}")
    @NoNeedAccess
    public Result getByCode(@PathVariable(value = "code") String code){
        return ResultUtil.success().setData(agreementService.getByCode(code));
    }
}
